package stu.ais.HomeWork;

public class Screen {
    private String type;

    private int size;

    private String brand;

    public Screen() {
    }

    public Screen(String type, int size, String brand) {
        this.type = type;
        //this.size = size;
        setSize(size);
        this.brand = brand;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        //对于显示器尺寸，必需是 17\23\19\25	，其它尺寸都不合格，
        if(size == 17 || size==23 || size==19 || size==25){
            this.size = size;
            return;
        }
        this.size=17;
        //System.out.println("sorry,size不是合法的!");
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    @Override
    public String toString() {
        return "Screen{" +
                "type='" + type + '\'' +
                ", size=" + size +
                ", brand='" + brand + '\'' +
                '}';
    }
}
